home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / os2 / cenvi2.arj / WINLIST.CMD < prev    next >
OS/2 REXX Batch file  |  1993-11-06  |  1KB  |  26 lines

  1. EXTPROC CEnvi
  2. /******************************************************************
  3.  *** WinList - CEnvi program to display all windows that may be ***
  4.  ***           switched to.                                     ***
  5.  ******************************************************************/
  6.  
  7. #include <PMdll.lib>
  8. #include <WinTools.lib>
  9.  
  10. // create list of switchable windows
  11. SwitchList = WinQuerySwitchList(Info().hab);
  12. assert( SwitchList != NULL );
  13. SwitchCount = 1 + GetArraySpan(SwitchList);
  14. printf("Switch  Proc  Sess  WinHndl   Switch-Title/Window-Title\n");
  15. printf("------  ----  ----  --------  ----------------\n");
  16. for ( i = 0; i < SwitchCount; i++ ) {
  17.    printf(" %-8d",SwitchList[i]);
  18.    if ( 0 == WinQuerySwitchEntry(SwitchList[i],SwEntry) ) {
  19.       printf("%-6d%-5d%-10X%s",SwEntry.process,SwEntry.session,SwEntry.hwnd,SwEntry.title);
  20.       if ( (FullTitle = GetWindowTitle(SwEntry.hwnd)) )
  21.          printf("\n                            / %s",FullTitle);
  22.    }
  23.    printf("\n");
  24. }
  25.  
  26.